# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gnome-sudoku
pkgver=3.26.0+6+g0ffe857
pkgrel=1
pkgdesc="Test your logic skills in this number grid puzzle"
url="https://wiki.gnome.org/Apps/Sudoku"
arch=(x86_64 i686)
license=(GPL)
depends=(dconf gtk3 qqwing libgee json-glib)
makedepends=(intltool itstool vala yelp-tools autoconf-archive appstream-glib git)
groups=(gnome-extra)
_commit=0ffe857f43c912c32198aad13667defddea3019b  # master
source=("git+https://git.gnome.org/browse/gnome-sudoku#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  git tag -f 3.24.0 4a2a4dd7308e4152869d1f7846eda51d59283049

  # Work around aclocal exiting with "too many loops"
  mkdir m4
  cp /usr/share/aclocal/ax_require_defined.m4 m4

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-schemas-compile
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install

  sed -i 's_#! /usr/bin/python_#!/usr/bin/python2_' "$pkgdir/usr/bin/gnome-sudoku"
}
